﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using HNCDataSetTableAdapters;


public partial class UserControl_content_service : System.Web.UI.UserControl
{
    CategoryTableAdapter cate = new CategoryTableAdapter();
    ProductsTableAdapter pro = new ProductsTableAdapter();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            int CateID = int.Parse(HttpContext.Current.Request.RequestContext.RouteData.Values["CateID"].ToString());
            DataTable dt = cate.GetCateByCateID(CateID);
            lblTitle.Text = dt.Rows[0]["Title"].ToString();

            DataView dv = (DataView)pro.GetProductByCateID(CateID).DefaultView;
            CollectionPager1.PageSize = 12;
            CollectionPager1.DataSource = dv;
            CollectionPager1.BindToControl = rptService;
            rptService.DataSource = CollectionPager1.DataSourcePaged;
            rptService.DataBind();
        }
    }
}